#ifndef NETWORK_H
#define NETWORK_H

struct ip_and_socket {
	int sockfd;
	char *ip;
};

void error (char *msg);
void s_write (int sockfd, char *msg);
int s_read (int sockfd, char *buffer);
int create_tcp_socket (int portno);
struct ip_and_socket accept_client (int sockfd);
struct peer * find_peer_with_ip (struct ip_and_socket i_and_s);
#endif
